{% macro gen_form(form, current_user) %}
{% import "_my_wtf_macros.html" as my_wtf_macros %}

    <form id="search-demand-client-form" action="{{ url_for('op_bp.demand_clients') }}" method="post" class="form" role="form">
        {{ my_wtf_macros.form_field(form.user_mobile, div_col=4, label_col=4, field_col=7) }}
        {{ my_wtf_macros.form_field(form.user_nickname, div_col=4, label_col=4, field_col=7) }}
        {{ my_wtf_macros.form_field(form.sem_path, div_col=4, label_col=4, field_col=7) }}
        {{ my_wtf_macros.form_field(form.operate_time_filter, div_col=4, label_col=4, field_col=7) }}
        {{ my_wtf_macros.form_field(form.client_source, div_col=4, label_col=4, field_col=7) }}
        {{ my_wtf_macros.form_field(form.operate_result, div_col=4, label_col=4, field_col=7) }}
        {{ my_wtf_macros.form_field(form.sem_plan, div_col=4, label_col=4, field_col=7) }}
        {{ my_wtf_macros.form_field(form.sem_unit, div_col=4, label_col=4, field_col=7) }}
        {{ my_wtf_macros.form_field(form.sem_keyword, div_col=4, label_col=4, field_col=7) }}
        {{ my_wtf_macros.form_field(form.last_visit_time_begin, div_col=4, label_col=4, field_col=7) }}
        {{ my_wtf_macros.form_field(form.last_visit_time_end, div_col=4, label_col=4, field_col=7) }}
        <div class="clearfix visible-xs-block visible-sm-block visible-md-block visible-lg-block"></div>
        <div class="pull-right btn-group">
            <button type="submit" class="btn btn-info"
                    id="query-demand-btn">
                查询
            </button>
            {% if not current_user.is_agent %}
                <a
                    href="javascript:void(0);"
                    target="_blank"
                    class="btn-group btn btn-primary"
                    id="export-demand-clients"
                >
                    导出
                </a>
            {% endif %}
        </div>
    </form>
{% endmacro %}
